<!-- 
说明：收货地址表列表
作者：292303959@qq.com
日期：2018-10-18 19:52:1
版本：1.0.0
-->
<template>
  <div>
    <mk-search-box>
      <el-row>
        <el-col :span="5">
          <label>会员ID:</label>
          <el-input v-model="ui.searchData.mid"
                    size="small"></el-input>
        </el-col>
        <el-col :span="5">
          <label>省:</label>
          <el-input v-model="ui.searchData.province"
                    size="small"></el-input>
        </el-col>
        <el-col :span="5">
          <label>市:</label>
          <el-input v-model="ui.searchData.city"
                    size="small"></el-input>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="5">
          <label>区:</label>
          <el-input v-model="ui.searchData.area"
                    size="small"></el-input>
        </el-col>
        <el-col :span="5">
          <label>收件人:</label>
          <el-input v-model="ui.searchData.recipients"
                    size="small"></el-input>
        </el-col>
        <el-col :span="5">
          <label>地址:</label>
          <el-input v-model="ui.searchData.adress"
                    size="small"></el-input>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="5">
          <label>邮政编码:</label>
          <el-input v-model="ui.searchData.zipcode"
                    size="small"></el-input>
        </el-col>
        <el-col :span="5">
          <label>电话:</label>
          <el-input v-model="ui.searchData.cellphone"
                    size="small"></el-input>
        </el-col>
        <el-col :span="5">
          <label>创建日期:</label>
          <el-input v-model="ui.searchData.createdate"
                    size="small"></el-input>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="5">
          <label>是不是默认地址(0-是，1-否):</label>
          <el-input v-model="ui.searchData.flag"
                    size="small"></el-input>
        </el-col>
        <el-col :span="3">
          <mk-search-buttons v-model="ui.searching" />
        </el-col>
      </el-row>
    </mk-search-box>
    <el-row>
      <add @reload="doSearch" />
    </el-row>
    <mk-table v-model="ui"
              mk-multiple
              mk-index
              mk-sql-code="zMbAddress.select_list"
              mk-table-id="z-mb-address.list.common"
              ref="table">
      <el-table-column align="left"
                       prop="mid"
                       label="会员ID"
                       sortable="custom"
                       width="32" />
      <el-table-column align="left"
                       prop="province"
                       label="省"
                       sortable="custom"
                       width="20" />
      <el-table-column align="left"
                       prop="city"
                       label="市"
                       sortable="custom"
                       width="20" />
      <el-table-column align="left"
                       prop="area"
                       label="区"
                       sortable="custom"
                       width="20" />
      <el-table-column align="left"
                       prop="recipients"
                       label="收件人"
                       sortable="custom"
                       width="32" />
      <el-table-column align="left"
                       prop="adress"
                       label="地址"
                       sortable="custom"
                       width="500" />
      <el-table-column align="left"
                       prop="zipcode"
                       label="邮政编码"
                       sortable="custom"
                       width="32" />
      <el-table-column align="left"
                       prop="cellphone"
                       label="电话"
                       sortable="custom"
                       width="15" />
      <el-table-column align="left"
                       prop="createdate"
                       label="创建日期"
                       sortable="custom"
                       width="19" />
      <el-table-column align="left"
                       prop="flag"
                       label="是不是默认地址(0-是，1-否)"
                       sortable="custom"
                       width="1" />
      <el-table-column prop="doing"
                       align="center"
                       label="操作"
                       width="120">
        <template slot-scope="scope">
          <edit :row="scope.row"
                @reload="doSearch" />
        </template>
      </el-table-column>
    </mk-table>
  </div>
</template>

<script>
  import {
    MkBase
  } from 'element-ui'
  import Add from './list/add-button'
  import Edit from './list/edit-button'
  import searchData from './list/search-data'

  export default {
    name: 'z-mb-address-list',
    mixins: [MkBase],
    components: {
      Add,
      Edit
    },
    data () {
      return {
        ui: {
          searching: true,
          searchData: searchData()
        }
      }
    },
    methods: {
      /**
       * 刷新本页面
       */
      doSearch () {
        this.ui.searching = true
      }
    }
  }
</script>